Half Subtractor Virtual Laboratory

PrayogSetu — Interactive Digital Electronics Experiment
Digital Electronics
🎛️ Digital Input Controls
A Minuend
B Subtrahend
📊 Output Monitor & Status
DIFFERENCE (D) A ⊕ B 0
BORROW (Bₒ) A · B 0
NOT A (A) Inverted Minuend 1
✓ HALF SUBTRACTOR VERIFIED
Subtraction: 0 − 0 = 0 (Borrow 0, Difference 0)
⚡ Half Subtractor Logic Diagram & Signal Flow Animation
A Minuend 0 B Subtrahend 0 NOT A = 1 XOR AND D DIFFERENCE D = A ⊕ B 0 Bₒ BORROW Bₒ = A · B 0
📋 Half Subtractor Truth Table

Click any row to quickly set the inputs A and B:

Minuend (A) Subtrahend (B) Difference (D) Borrow (Bₒ) Expression
0 0 0 0 0 − 0 = 0 (Borrow 0)
0 1 1 1 0 − 1 = 1 (Borrow 1)
1 0 1 0 1 − 0 = 1 (Borrow 0)
1 1 0 0 1 − 1 = 0 (Borrow 0)
📖 Theory & Working Principle

What is a Half Subtractor?

A Half Subtractor is a fundamental combinational logic circuit used in digital electronics to subtract one single-bit binary number from another. It processes two input bits: the Minuend (A) and the Subtrahend (B), and generates two output bits: the Difference (D) and the Borrow (Bₒ).

Key Terminology

  • Minuend (A): The binary number from which another number is to be subtracted.
  • Subtrahend (B): The binary number that is subtracted from the minuend.
  • Difference (D): The resulting bit of binary subtraction (D = A ⊕ B).
  • Borrow (Bₒ): A signal generated when subtracting 1 from 0 (Bₒ = A · B). A borrow of 1 signifies that a unit must be borrowed from the next higher significant bit position.

Why is Borrow generated when A = 0 and B = 1?

In arithmetic subtraction, 0 − 1 cannot be calculated without borrowing from a higher column. In binary:
0₂ − 1₂ = Borrow 1 from next bit position → 10₂ − 1 = 1₂
Therefore, when A = 0 and B = 1, the Difference becomes 1 and the Borrow output becomes 1.

Logic Gate Functions

XOR Gate

Computes Difference (D = A ⊕ B). Outputs 1 when inputs are different (0,1 or 1,0), representing binary subtraction magnitude without borrow.

NOT Gate

Inverts minuend A (A). When A = 0, A = 1, enabling the condition required for a borrow.

AND Gate

Computes Borrow (Bₒ = A · B). Combines inverted minuend A with subtrahend B, outputting 1 strictly when A = 0 and B = 1.

Why is there no Borrow-In (Bᵢₙ) Input?

A Half Subtractor is limited to subtracting two single bits. It does not accept a Borrow-In (Bᵢₙ) signal from a preceding lower-significant bit calculation. To perform multi-bit binary subtraction where borrows propagate across bit positions (e.g. 4-bit or 8-bit subtractors), a Full Subtractor (which includes 3 inputs: A, B, and Bᵢₙ) must be used.